<?php
session_start();
include_once("include/ini.php");
require_once ("model/m_movie.php");

 if (!isset($_SESSION['userid'])){ 
    echo "<meta http-equiv = refresh ; content = '0 ; url = index.php'>";
    exit();
 }
 
$m_movie = new M_movie();
  
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ORDER</title>


<script src="js/jquery-1.4.4.min.js" type="text/javascript" ></script>
<script src="js/jquery-ui-1.8.9.custom.min.js" type="text/javascript" ></script>
<script src="js/js_tool_ui.js" type="text/javascript" ></script>
<script src="js/jquery.blockUI.js"></script>

<script src="js/ui/jquery.ui.core.js"></script>
<script src="js/ui/jquery.ui.widget.js"></script>
<script src="js/ui/jquery.ui.mouse.js"></script>
<script src="js/ui/jquery.ui.button.js"></script>
<script src="js/ui/jquery.ui.position.js"></script>
<script src="js/ui/jquery.ui.dialog.js"></script>

<link rel="stylesheet" media="screen" href="css/reset.css" />
<link rel="stylesheet" media="screen"  href="css/grid.css" />
<link rel="stylesheet" media="screen"  href="css/forms.css" />
<link rel="stylesheet" media="screen"  href="css/style.css" />
<link rel="stylesheet" media="screen" href="css/messages.css" />
<link rel="stylesheet" media="screen" href="css/tables.css" />
<link rel="stylesheet" media="screen"  href="css/main.css" />
<link rel="stylesheet" media="screen"  href="css/myStyle.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.22.custom.css" />

<script type="text/javascript"> 
    var a="";
    var s_cc="";
   
    $(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
    
</script>

<script src="js/js_order.js"></script>
<style>
    textarea{
        width:350px!important;
    }
    select{
        padding:3px;
        margin-left:10px;
        margin-bottom:10px;
    }
    a{
        color:#666;
    }
    a:hover{
        cursor:pointer;
    }
    table.datatable > tbody > tr > td{
        color:#666!important;
    }
    
</style>
</head>
<?php
function arrayToSelect($option, $selected = '', $optgroup = NULL)
{
    $returnStatement = '';

    if ($selected == '') {
        $returnStatement .= '<option value="0" selected="selected">Select one...</option>';
    }

    if (isset($optgroup)) {
        foreach ($optgroup as $optgroupKey => $optgroupValue) {
            $returnStatement .= '<optgroup label="' . $optgroupValue . '">';

            foreach ($option[$optgroupKey] as $optionKey => $optionValue) {
                if ($optionKey == $selected) {
                    $returnStatement .= '<option selected="selected" value="' . $optionKey . '">' . $optionValue . '</option>';
                } else {
                    $returnStatement .= '<option value="' . $optionKey . '">' . $optionValue . '</option>';
                }
            }

            $returnStatement .= '</optgroup>';
        }
    } else {
        foreach ($option as $key => $value) {
            if ($key == $selected) {
                $returnStatement .= '<option selected="selected" value="' . $key . '">' . $value . '</option>';
            } else {
                $returnStatement .= '<option value="' . $key . '">' . $value . '</option>';
            }
        }
    }
    
      return $returnStatement;
    }
?>
<body>

   <!-- Begin Wrapper -->
   <div id="wrapper">
        <INPUT type=hidden value="desc" id="ord" name="ord">
         <!-- Begin Navigation -->
         <div id="navigation">
            <span class="logo"><img src="images/logo.jpg" alt="" width="360" height="100" /></span>  
            <span class="menu">
            <ul style="padding:0;">
                <li><a href="index.php">หน้าหลัก</a></li>
                <li><a href="payment.php">วิธีการชำระเงิน  </a></li>
                <li><a href="logout.php" class="btnLogout">ออกจากระบบ </a></li>
            </ul>

            
            </span>   
         </div>
<!-- End Navigation -->
   
         <!-- Begin Header -->
          <div class="main-content">
               <section class="container_8 clearfix">
                 <div class="grid_7">
                <h3>คุณต้องการ Copy หนังจาก CopyHidef.com เป็นจำนวน  <span class="totalGB">0</span>Gb.</h3>
                </div>
               <div class="grid_7 clearfix">
                        <div class="message error" style="display: none" >
                            <h3>Information</h3>
                            <p>
                                                                                                                     กรุณากรอกข้อมูลให้ครบถ้วน
                            </p>
                        </div>
                  </div>
                 <div class="grid_7">
                      <form id="form" class="form" method="post" novalidate="novalidate">
                                
                                <div class="clearfix">
                                    <label style="margin-bottom:10px;">สั่ง HDD พร้อมข้อมูล:</label>
                                    <select id="cboHdd"><?php echo arrayToSelect($arr_copycost);?></select>
                                </div>
                                
                                <div class="clearfix">
                                    <label>ส่งถึง:</label>
                                    <input type="text" id="txtReName" name="txtReName" class="large" maxlength="20" style="width:400px;" >
                                </div>
                                <div class="clearfix">
                                    <label>ที่อยู่ / หมายเหตุ:</label>
                                    <textarea class="large" id="txtAddress" rows="5" style='width:410px!important;'></textarea>
                                </div>          

                                 <div class="action clearfix">
                                    <button class="large button button-green" type="button" id="btnOrder">ยืนยัน</button>
                                </div>
                                     </form>
                      
                 </div>
                  <br/><br/><br/>
                  <div class="clearfix"  style="line-height:30px;">&nbsp;</div>
                  <div class="clearfix"  style="line-height:30px;">&nbsp;</div>
                  <div class="clearfix">&nbsp;</div>
                  
                    <div class="grid_7">
                     <h3>แสดงรายการหนังที่คุณเลือกไว้ ดังนี้ </h3>
                    </div>
                    <div class="grid_7 clearfix">
                        <table id="resultData" class="datatable simple full">
                        <thead>
                           <tr>
                                    <th width="5%" style='text-align: center;'>#</th>
                                    <th style="display:none">id</th>
                                    <th width="15%" style='text-align: center;'><a id="category" class="sort">แนวหนัง</a></th>
                                    <th width="55%" style='text-align: center;'><a id="directoryname" class="sort">ชื่อหนัง</a></th>
                                    <th width="10%" nowrap="nowrap" style='text-align: center;'><a id="filesize_GB" class="sort">ขนาด(GB)</a></th>
                                    <th width="10%" nowrap="nowrap" style='text-align: center;'><a id="filetype" class="sort">ประเภท</a></th>
                                    <th width="5%" nowrap="nowrap" style='text-align: center;'>ลบ</th>
                          </tr>
                        </thead>
                       <tbody>
                                   
                       </tbody>
                       </table>
                    </div>
               
               </section>
           </div>
         <!-- End Header -->
 
         <!-- Begin Footer -->
          <span class="footermenu">
            <a href="index.php">หน้าหลัก</a> I <a href="payment.php">วิธีการชำระเงิน</a> I 
             <a href="logout.php" class="btnLogout">ออกจากระบบ </a>   
               <br />
www.copyhidef.com
         </span>
         <!-- End Footer -->
         
   </div>
   <!-- End Wrapper -->
  
   
<!-- overlayed element -->
<div class="apple_overlay" id="overlay">
  <!-- the external content is loaded inside this tag -->
  <div class="contentWrap"></div>
</div>
</body>
</html>
